package leesoft.configuration.databeans;

import org.dom4j.Element;

import leesoft.configuration.interfaces.IXmlToBean;

public class DataSource implements IXmlToBean {
	String connectionString;
	String driver;
	String username;
	String password;
	
	public String getConnectionString() {
		return connectionString;
	}

	public void setConnectionString(String connectionString) {
		this.connectionString = connectionString;
	}

	public String getDriver() {
		return driver;
	}

	public void setDriver(String driver) {
		this.driver = driver;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public DataSource(String conn,String driver,String username,String password){
		this.connectionString=conn;
		this.driver=driver;
		this.username=username;
		this.password=password;
	}
	public DataSource(){}

	@Override
	public void convertXml(Element element) {
		String connectionString=element.elementText("connectionString");
		String driver=element.elementText("driver");
		String username=element.elementText("username");
		String password=element.elementText("password");
		this.connectionString=connectionString;
		this.driver=driver;
		this.username=username;
		this.password=password;
	}
}
